<?php
declare (strict_types = 1);

namespace app\common\validate;

use think\Validate;
class StudyStudentList extends Validate
{
    protected $rule = ['username' => 'require','sex' => 'require','class_id' => 'require','height' => 'require','weight' => 'require','head_length' => 'require','end_time' => 'require',
    ];

    protected $message = ['username.require' => '姓名为必填项','sex.require' => '性别为必填项','class_id.require' => '班级ID为必填项','class_id.number' => '班级ID需为数字','height.require' => '身高为必填项','height.number' => '身高需为数字','weight.require' => '体重为必填项','weight.number' => '体重需为数字','head_length.require' => '头围为必填项','head_length.number' => '头围需为数字','end_time.require' => '到期时间为必填项','mobile.require' => '联系电话为必填项','end_time.number' => '到期时间需为数字',
    ];

    /**
     * 添加
     */
    public function sceneAdd()
    {
        return $this->only(['username','sex','class_id','mobile','parent_id','end_time']);
    }

    /**
     * 编辑
     */
    public function sceneEdit()
    {
        return $this->only(['username','sex','class_id','mobile','parent_id','end_time']);
    }
}
